

( ()=>{

    window.onload  = function (){
        initPage();
    }
    

    function initPage (){
        
        
        // 调用搜索组件事件集合
        let searchCompoment = new seeyonSearch({
            // 执行搜索回调
            callback:function(value){
                console.log(value);
                window.localStorage.setItem("seeyon-dolphin-searchKey",value);
                window.location.href = "./result.html";
            },
            //清除历史记录
            clearCallback:function(){
                $.ajax({
                    type:"",
                    url:"",
                    success: result =>{

                    },
                    error:e => console.log(e)
                })
            }
        });

        //初始化获取一次历史记录
        $.ajax({
            type:"GET",
            url:"",
            success: result =>{
                if(result){
                    searchCompoment.initHistory(result);
                }
            },
            error: e =>{
                console.log(e);
            }
        });
        
        
    }

    


})();